import React, {useCallback, useState} from 'react';
import {View, StyleSheet} from 'react-native';
import Colors from '../../utils/Colors';
import SearchTop from '../../component/search/SearchTop';
import SearchType from '../../component/search/SearchType';
import SearchRecommend from '../../component/search/SearchRecommend';
import {useTrackData} from '../../mixins';
const style = StyleSheet.create({
  activityView: {
    flex: 1,
    position: 'relative',
    width: '100%',
    backgroundColor: Colors.white,
  },
});
const Search = () => {
  const [hotWords, setHotWords] = useState([]);
  const getSearchData = useCallback(data => {
    setHotWords(data.new_hot_words);
  }, []);
  useTrackData();
  return (
    <View style={style.activityView}>
      {/* 顶部搜索 */}
      <SearchTop getSearchData={getSearchData} />
      {/* 展示分类页 */}
      <SearchType />
      {/* 推荐 */}
      <SearchRecommend hotWords={hotWords} />
    </View>
  );
};

export default Search;
